package flex.cc.uac.controller;

import flex.cc.core.annotation.OperationLogDto;
import flex.cc.core.support.BaseController;
import flex.cc.uac.service.UacLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 不认证的请求
 */
@RestController
@RequestMapping(value = "/auth")
public class AuthRestController extends BaseController {
    @Resource
    private UacLogService uacLogService;
    /**
     * 保存操作日志
     */
    @PostMapping(value = "/saveLog")
    @ApiOperation(httpMethod = "POST", value = "保存操作日志")
    public Boolean saveLog(@RequestBody OperationLogDto operationLogDto) {
        logger.info("saveLog - 保存操作日志. operationLogDto={}", operationLogDto);
        return uacLogService.saveOperationLog(operationLogDto);
    }
}
